/*----------------------------------------------------------------------------
 *      U S B  -  K e r n e l
 *----------------------------------------------------------------------------
 * Name:    usbram.c
 * Purpose: USB Custom User Module
 * Version: V1.01
 * Date:		2017/07
 *------------------------------------------------------------------------------*/
#include	<SN32F280.h>
#include	"usbram.h"

/*_____ D E C L A R A T I O N S ____________________________________________*/
/*_____________ USB Variable ____________________________________________*/
volatile	uint32_t	wUSB_EPnOffset[6];
volatile	uint32_t	wUSB_EPnPacketsize[7];
volatile	uint8_t		wUSB_EndpHalt[7];
const	uint8_t	*pUSB_TableIndex;
volatile	uint32_t	wUSB_TableLength;
volatile	uint8_t	wUSB_IfAlternateSet[6];
uint8_t		bNDT_Flag;
uint16_t	dbNDT_Cnt;
uint32_t	wUSB_PreTableLength;

uint8_t		bUSB_MouseMode = 0;
uint8_t		bUSB_MouseCnt = 0;
uint32_t	wUSB_MouseData = 0;

uint8_t EP3_out_flag;
uint8_t EP4_in_flag;
uint8_t rOutBuf[4096];
uint8_t rEp4_InBuf[64];
uint8_t rEPOut_Frame_Index;

//USB Interrupt FIFO Read/Write Data buffer
volatile uint32_t	wUSBINT_ReadDataBuf;
volatile uint32_t	wUSBINT_WriteDataBuf;

//USB Main Loop FIFO Read/Write Data buffer
volatile uint32_t	wUSBMAIN_ReadDataBuf;
volatile uint32_t	wUSBMAIN_WriteDataBuf;

SUSB_EUME_DATA	sUSB_EumeData;
